* Fix NMEA parsing creating Null Island waypoints
Fix parsing of NMEA GPGGA sentences: ones with 0 "fix quality" (i.e. "invalid") are allowed in serial (i.e. live GPS) mode because (according to the comment) some GPS devices will report previously-read data in the absence of a current good fix. Adjust this allowance to require an actual coordinate value; at least one popular USB GPS device will issue GPGGA such as "$GPGGA,010222.00,,,,,0,00,99.99,,,,,,*65" if it loses a good fix, and the empty lat/lng coordinates (",,,,,") are parsed as 0N 0W (a.k.a. "Null Island"). QString::toDouble() won't report a problem with an empty input so we simply check for 0 lat/lng.
* Use "ok" QString::toDouble() argument instead
... of checking for checking for both lat & lng exactly zero, as `ok` does indeed get set to `false` on empty inputs, in recent Qt versions.
* Revert "Use "ok" QString::toDouble() argument instead"
This reverts commit
d226d01c862606615aa599f5d3b649cea12f0700.
/*
* In serial mode, allow the fix with an invalid position through
+ * (unless if the position lat/lng is absent or completely bogus)
* as serial units will often spit a remembered position up and
* that is more comfortable than nothing at all...
*/
CHECK_BOOL(opt_ignorefix);
- if ((fix <= 0) && (read_mode != rm_serial) && (!opt_ignorefix)) {
+ if ((fix <= 0) && (read_mode != rm_serial || (latdeg == 0.0 && lngdeg == 0.0)) && (!opt_ignorefix)) {
return;
}